<template>
    <a-carousel  arrows autoplay>
        <div
                slot="prevArrow"

                class="custom-slick-arrow"
                style="left: 10px;zIndex: 1;"
        >
            <a-icon type="left-circle" />
        </div>
        <div slot="nextArrow"  class="custom-slick-arrow" style="right: 10px">
            <a-icon type="right-circle" />
        </div>
        <div class="swing" v-for="(item,index) in list" :key="index" :style="{'background-image':'url('+item.imgUrlPc+')'}">
<!--            <img :src="item.imgUrl" alt="">-->
        </div>

    </a-carousel>
</template>
<script>
    import {getswipe} from "../api/api";

    export default {
        data(){
          return{
              list:[]
          }
        },
        created() {
            getswipe(4).then(res=>{
                this.list=res.data
                console.log(this.list)
            })
        }
    };
</script>
<style scoped>
    .swing{
        background-repeat: no-repeat;
        background-position: 50%;
        width: 100%;
        height: 400px;
        background-size: cover;
    }
    /* For demo */
    .ant-carousel >>> .slick-slide {
        text-align: center;
        height: 400px;
        /*line-height: 160px;*/
        background: #364d79;
        overflow: hidden;
    }

    .ant-carousel >>> .custom-slick-arrow {
        width: 25px;
        height: 25px;
        font-size: 25px;
        color: #fff;
        background-color: rgba(31, 45, 61, 0.11);
        opacity: 0.3;
    }
    .ant-carousel >>> .custom-slick-arrow:before {
        display: none;
    }
    .ant-carousel >>> .custom-slick-arrow:hover {
        opacity: 0.5;
    }

    .ant-carousel >>> .slick-slide h3 {
        color: #fff;
    }
    img{
        width: 100%;
        height: 400px;
    }
</style>